{% extends "../../theme/bage.html" %}
{% block head %}
<title>
    {% if state %}{% if state[0]=='1' %} {{ _('Pending review list') }}
    {% elif state[0]=='0' %}{{ _('Information review list') }}
    {% elif state[0]=='3' %} {{ _('Review failed list') }} {% else %} {{ _('Approved list') }}{% end %} {% else %}
    {{ _('Audit information list') }}
    {% end %} </title>

{% end %}

{% block typebody %}
<style>
    .panel-body a{
        display:block;margin:5px;padding:5px;background: #fff;border: 1px solid #ddd; color: #333;
    }
</style>
<div class="row">
    <ul class="breadcrumb">
        <li><a href="/" title="home">{{ _('Home') }}</a></li>
        <li><a href="/check/publish">{{ _('List of published information') }}</a></li>
        <li><a href="/check/publish?kind={{ kwd['kind'] }}">{% raw kwd['post_type'] %}</a></li>
        <li class="active">

            {{ _('List of published information') }}

        </li>
    </ul>
    <div class="col-sm-8">


        <div class="panel panel-black">
            <div class="panel-heading">
                <h3 class="panel-title">
                    {{ kwd['post_type'] }} -

                    {{ _('List of published information') }}

                </h3></div>
            <table class="table table-bordered table-condensed table-striped">
                <tr>

                    <th>ID</th>
                    <th>{{ _('Title') }}</th>
                </tr>
                {% for rec in recs %}
                <tr>

                    <td>{{ rec.uid }}</td>
                    <td><a href="/{{ kwd['router'] }}/{{ rec.uid }}">{{ rec.title }}</a></td>

                </tr>
                {% end %}
            </table>

            <div class="col-sm-12">
                <div class="row">
                    {% module check_username_pager( kwd['current_page'],username = userinfo.user_name,kind=kwd['kind']) %}
                </div>
                <div class="row">
                    Go to <input id="changePage" type="text" size="1" maxlength="4"
                                 style=" border: 3px solid #fff; height: 20px "/>
                    page
                    <a href="#" id="btn5" class="btn btn-xs btn-primary">{{ _('Jump') }}</a>
                </div>
            </div>
        </div>
    </div>
    <div class="col-sm-4">
        <div class="panel panel-black">
            <div class="panel-heading">
                <h3 class="panel-title">
                    {{ _('List of published information') }}
                </h3></div>
            <div class="panel-body">

              {% module publish_list_menu('publish') %}

            </div>
        </div>
    </div>
</div>


<br>
<script type="text/javascript">
    var page = '{{kwd['pager_num']}}';
    var state = '{{str(state)[0:]}}';
    var kind = '{{kwd['kind']}}';

    $("#btn5").click(function changePage() {
        var curPage = document.getElementById("changePage").value * 1;
        if (!/^[1-9]\d*$/.test(curPage)) {
            $("#fyts").val("Please enter a positive integer");
            return;
        }
        if (curPage > page) {

            document.getElementById("fyts").innerText = "Exceed the data page";
            return;
        }
        window.location.href = "/check/publish/" + curPage + "?state=" + state + "&kind=" + kind;
    });
</script>
{% end %}

